home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / vga16.com / VGA16.DOC < prev   
Encoding:
Text File  |  1990-02-23  |  11.7 KB  |  240 lines

  1. Documentation for the VGA16.BGI device driver.
  2.    by John Sieraski 2/23/90
  3.  
  4. * This release corrects a bug with video mode initialization on Video-7
  5. and VEGA VGA cards that was present in the initial version!
  6.  
  7. The VGA16.BGI device driver is a device driver which supports various 16 color
  8. VGA graphics modes which can be used within Turbo C 2.0 and/or Turbo Pascal 5.5
  9. programs.  No support for 256 color graphics display modes are provided by
  10. this driver.
  11.  
  12. Technical details:
  13.  
  14. This driver was written by me (John Sieraski).   The shell for the driver is
  15. written in Turbo C 2.0 with the time critical support routines written using
  16. Turbo Assembler 1.0's Ideal mode syntax.  All of the display routines use
  17. the EGA/VGA write mode 2 (the fastest mode) and write directly to the device
  18. without going through the BIOS.  Whenever a particular display routine is done
  19. doing it's job, the card is returned to write mode 0 (The default).  The video
  20. mode switching, display page switching, and palette control is done through
  21. calls to interrupt 10h BIOS functions.  The video mode values used in the
  22. interrupt 10h set video mode calls are listed in the table below, so if your
  23. card uses the same video mode value shown for one of the supported cards,
  24. chances are that selecting that mode will work on your card.  If you have an
  25. enhanced VGA not supported by this driver, drop me a note and I'll see about
  26. adding support for your card.
  27.  
  28. List of files:
  29.  
  30. Filename        Description
  31. --------        -----------
  32. VGA16.DOC       Documentation for the VGA16.BGI device driver (This file).
  33.  
  34. VGA16.BGI       A BGI driver supporting various EGA/VGA 16 color graphics modes.
  35.  
  36. DEMO.C          A Turbo C 2.0 program which demonstrates some of the enhanced
  37.                 features supported by the VGA16.BGI device driver.
  38.  
  39. Display modes supported by the VGA16.BGI driver:
  40.  
  41. BGI Mode    Display card    Resolution  Interrupt 10h    number of
  42. number                                    video mode     display pages
  43. --------    ------------    ----------  -------------    -------------
  44.    0         EGA/VGA         320x200        0Dh               8
  45.    1         EGA/VGA         640x200        0Eh               4
  46.    2         EGA/VGA         640x350        10h               2
  47.    3         VGA             640x480        12h               1
  48.    4         ATI VGA         800x600        54h               1
  49.    5         Orchid VGA      800x600        29h               1
  50.    6         Paradise VGA    800x600        58h               1
  51.    7         VEGA VGA        800x600        62h               1
  52.    8         Video7 VGA      800x600        62h               1
  53.    9         SOTA VGA-16     800x600        29h               1
  54.  
  55. The VGA16.BGI driver provides a couple of extra features which are not
  56. supported by the standard BGI drivers supplied with Turbo C and Turbo Pascal.
  57. The following is a description of the enhanced capabilities:
  58.  
  59. Support for two color fill patterns
  60. -----------------------------------
  61. The standard BGI drivers allow you to set the colors that the 1's in the
  62. fill patterns get plotted in, but do not allow you to alter the color that
  63. the 0's get plotted in.  The 0's in a standard BGI driver are always plotted
  64. in color zero.  The default setting for fills in the VGA16 driver is the same
  65. as it is in a standard driver i.e. zeros in fill patterns are plotted in color
  66. zero.  To change the color that the zeros get plotted in, you need to make a
  67. call to the setwritemode() function.  The mode value that you pass to the
  68. setwritemode() function is used to control the color that the zeros in fill
  69. patterns will be plotted in.  The valid mode values for controlling fill
  70. pattern background colors are as follows:
  71.  
  72. mode value      action performed
  73. ----------      ----------------
  74. 6               toggles the plotting of zeros in fill patterns ON in color 0.
  75. 7               toggles the plotting of zeros in fill patterns ON in color 1.
  76. 8               toggles the plotting of zeros in fill patterns ON in color 2.
  77. 9               toggles the plotting of zeros in fill patterns ON in color 3.
  78. 10              toggles the plotting of zeros in fill patterns ON in color 4.
  79. 11              toggles the plotting of zeros in fill patterns ON in color 5.
  80. 12              toggles the plotting of zeros in fill patterns ON in color 6.
  81. 13              toggles the plotting of zeros in fill patterns ON in color 7.
  82. 14              toggles the plotting of zeros in fill patterns ON in color 8.
  83. 15              toggles the plotting of zeros in fill patterns ON in color 9.
  84. 16              toggles the plotting of zeros in fill patterns ON in color 10.
  85. 17              toggles the plotting of zeros in fill patterns ON in color 11.
  86. 18              toggles the plotting of zeros in fill patterns ON in color 12.
  87. 19              toggles the plotting of zeros in fill patterns ON in color 13.
  88. 20              toggles the plotting of zeros in fill patterns ON in color 14.
  89. 21              toggles the plotting of zeros in fill patterns ON in color 15.
  90.  
  91. For example, the following call to setwritemode() would toggle the plotting
  92. of zeros in fill patterns ON in color 7:
  93.  
  94. #define SET_BACK 6
  95.  
  96. setwritemode(SET_BACK+7);
  97.  
  98. Support for transparent fill patterns
  99. -------------------------------------
  100. In the standard BGI drivers, the zeros in fill patterns are always plotted
  101. in color zero.  I've added an extension into the VGA16.BGI driver which allows
  102. you to toggle OFF the plotting of zeros in fill patterns so that you can get
  103. a transparent effect when filling overlapping regions.  To toggle the plotting
  104. of the zeros in fill patterns OFF you make the following call to
  105. setwritemode():
  106.  
  107. #define NO_BACK 4
  108.  
  109. setwritemode(NO_BACK);
  110.  
  111. Support for two color line patterns
  112. -----------------------------------
  113. The standard BGI drivers allow you to set the colors that the 1's in the
  114. line patterns get plotted in, but do not allow you to alter the color that
  115. the 0's get plotted in.  The 0's in a standard BGI driver are always plotted
  116. in color zero.  The default setting for patterned lines in the VGA16 driver is
  117. the same as it is in a standard driver i.e. zeros in line patterns are plotted
  118. in color zero.  To change the color that the zeros get plotted in, you need to
  119. make a call to the setwritemode() function.  The mode value that you pass to
  120. the setwritemode() function is used to control the color that the zeros in line
  121. patterns will be plotted in.  The valid mode values for controlling line
  122. pattern background colors are as follows:
  123.  
  124. mode value      action performed
  125. ----------      ----------------
  126. 22              toggles the plotting of zeros in line patterns ON in color 0.
  127. 23              toggles the plotting of zeros in line patterns ON in color 1.
  128. 24              toggles the plotting of zeros in line patterns ON in color 2.
  129. 25              toggles the plotting of zeros in line patterns ON in color 3.
  130. 26              toggles the plotting of zeros in line patterns ON in color 4.
  131. 27              toggles the plotting of zeros in line patterns ON in color 5.
  132. 28              toggles the plotting of zeros in line patterns ON in color 6.
  133. 29              toggles the plotting of zeros in line patterns ON in color 7.
  134. 30              toggles the plotting of zeros in line patterns ON in color 8.
  135. 31              toggles the plotting of zeros in line patterns ON in color 9.
  136. 32              toggles the plotting of zeros in line patterns ON in color 10.
  137. 33              toggles the plotting of zeros in line patterns ON in color 11.
  138. 34              toggles the plotting of zeros in line patterns ON in color 12.
  139. 35              toggles the plotting of zeros in line patterns ON in color 13.
  140. 36              toggles the plotting of zeros in line patterns ON in color 14.
  141. 37              toggles the plotting of zeros in line patterns ON in color 15.
  142.  
  143. For example, the following call to setwritemode() would toggle the plotting
  144. of zeros in line patterns ON in color 11:
  145.  
  146. #define LINE_BACK 22
  147.  
  148. setwritemode(LINE_BACK+11);
  149.  
  150. Support for transparent line patterns
  151. -------------------------------------
  152. In the standard BGI drivers, the zeros in line patterns are always plotted
  153. in color zero.  I've added an extension into the VGA16.BGI driver which allows
  154. you to toggle OFF the plotting of zeros in line patterns so that you can get
  155. a transparent effect when plotting overlapping patterned lines.  To toggle the
  156. plotting of the zeros in line patterns OFF you make the following call to
  157. the setwritemode() function:
  158.  
  159. #define NO_LINE_BACK 5
  160.  
  161. setwritemode(NO_LINE_BACK);
  162.  
  163. Support for extended line transfer modes
  164. ----------------------------------------
  165. The standard mode values supported by the setwritemode() function for
  166. controlling the transfer mode used by the line drawing routines are:
  167.  
  168. 0 : for overwrite transfer mode (COPY_PUT).
  169. 1 : for XOR transfer mode (XOR_PUT).
  170.  
  171. The VGA16 driver adds support for the following additional line transfer
  172. modes:
  173.  
  174. 2 : for AND transfer mode (AND_PUT).
  175. 3 : for OR transfer mode (OR_PUT).
  176.  
  177. Standard BGI functions not supported by VGA16.BGI:
  178. --------------------------------------------------
  179. The only function defined in the standard BGI interface that isn't supported
  180. by the VGA16 driver is support for the floodfill() function.  I'll probably
  181. add support for floodfill() in a future release, but I didn't want to delay
  182. making this driver available until I debug my current floodfill routine.  If
  183. you make a call to floodfill() within a program, the function call will just
  184. do nothing and then return.
  185.  
  186. Bugs
  187. ----
  188. If you experience any problems in using this driver, I'd appreciate it if
  189. you'd let me know.
  190.  
  191. I can be contacted on BIX as "jsieraski".
  192.  
  193. I can be contacted on Compuserve as John Sieraski 76117,2022.
  194.  
  195. I also have an MCI MAIL account "jsieraski".
  196.  
  197. Distribution
  198. ------------
  199. This driver may be distributed freely as long as no fee (besides download
  200. costs) are required.  I take no responsibility for any problems you might
  201. encounter when using this driver, but if you have any trouble, I'd
  202. appreciate it if you'd let me know so that I can attempt to correct the
  203. problem(s).
  204. Enjoy!
  205.  
  206.          ----------------end-of-author's-documentation---------------
  207.  
  208.                         Software Library Information:
  209.  
  210.                    This disk copy provided as a service of
  211.  
  212.                         The Public (Software) Library
  213.  
  214.          We are not the authors of this program, nor are we associated
  215.          with the author in any way other than as a distributor of the
  216.          program in accordance with the author's terms of distribution.
  217.  
  218.          Please direct shareware payments and specific questions about
  219.          this program to the author of the program, whose name appears
  220.          elsewhere in  this documentation. If you have trouble getting
  221.          in touch with the author,  we will do whatever we can to help
  222.          you with your questions. All programs have been tested and do
  223.          run.  To report problems,  please use the form that is in the
  224.          file PROBLEM.DOC on many of our disks or in other written for-
  225.          mat with screen printouts, if possible.  The P(s)L cannot de-
  226.          bug programs over the telephone.
  227.  
  228.          Disks in the P(s)L are updated monthly, so if you did not get
  229.          this disk  directly from the P(s)L,  you should be aware that
  230.          the files in this set may no  longer be the current versions.
  231.  
  232.          For a copy of the latest monthly software library newsletter
  233.          and a list of the 2,000+ disks in the library, call or write
  234.  
  235.                         The Public (Software) Library
  236.                               P.O.Box 35705
  237.                            Houston, TX 77235-5705
  238.                                (713) 524-6394
  239.  
  240.